<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../jstl/taglibs.jsp"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta name="keywords" content="OVVI OTA Manager">
<meta name="description" content="OVVI OTA Manager">
<title>WQL后台管理系统</title>
<%@ include file="../jstl/common_static_resources.jsp"%>
<script type="text/javascript" src="/static/web/js/user/modify.js"></script>
</head>
<body>
	<div class="page-container page-container-add">
		<c:set var="url" value="/user/save" />
		<c:if test="${not empty user.id }">
			<c:set var="url" value="/user/update" />
		</c:if>
		<form class="form form-horizontal" id="form-add" action="${url }" method="post">
			<input type="hidden" value="${user.id }" name="id" /> <input type="hidden" value="${user.registertime }" name="registertime" />
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>用户名：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" maxlength="255" value="${user.username }" placeholder="用户名" id="username" name="username">
				</div>
			</div>
			<c:choose>
				<c:when test="${empty user.id }">
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>密码：</label>
						<div class="formControls col-xs-8 col-sm-9">
							<input type="password" class="input-text" maxlength="255" value="${user.password }" placeholder="密码" id="password" name="password">
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>再次输入密码：</label>
						<div class="formControls col-xs-8 col-sm-9">
							<input type="password" class="input-text" maxlength="255" value="${user.password }" placeholder="密码" id="password2" name="password2">
						</div>
					</div>
				</c:when>
				<c:otherwise>
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-2">密码：</label>
						<div class="formControls col-xs-8 col-sm-9">
							<input type="password" class="input-text" maxlength="255" value="${user.password }" placeholder="密码" id="password" name="password">
						</div>
					</div>
					<div class="row cl">
						<label class="form-label col-xs-4 col-sm-2">再次输入密码：</label>
						<div class="formControls col-xs-8 col-sm-9">
							<input type="password" class="input-text" maxlength="255" value="${user.password }" placeholder="密码" id="password2" name="password2">
						</div>
					</div>
				</c:otherwise>
			</c:choose>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>所属角色：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<span class="select-box"> <c:forEach items="${user.roles }" var="role">
							<input type="checkbox" name="checkedRoles" value="${role.id }" id="ck_${role.id }" <c:if test="${role.checked }">checked</c:if> />
							<label for="ck_${role.id }">${role.roledesc }</label>
						</c:forEach>
					</span>
				</div>
			</div>
			<div class="row cl">
				<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
					<button class="btn btn-primary radius" type="submit">
						<i class="Hui-iconfont">&#xe632;</i> 保存并提交
					</button>
					<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
				</div>
			</div>
		</form>
	</div>
</body>
</html>